﻿using System;

namespace CompactMapper.Orm.Annotations
{
    public class TextColumnAttribute : ColumnAttribute
    {
        private int _maxLength;

        public TextColumnAttribute(int maxLength)
        {
            MaxLength = maxLength;
        }

        public TextColumnAttribute()
        {
        }

        public int MaxLength
        {
            get { return _maxLength; }
            private set
            {
                if (value < 1)
                    throw new ArgumentOutOfRangeException("maxLength", "must be greater than 0");
                _maxLength = value;
            }
        }
    }
}